import config from '@/config'
import { getIndexBannerList, getBannerListByType,getAboutMeList } from '@/api/photo/photo'

const baseUrl = config.baseUrl

const photo = {
    mutations: {

    },

    actions: {
        //首页轮播图
        GetIndexBannerList({ commit }) {
            return new Promise((resolve, reject) => {
                getIndexBannerList({}).then(res => {
                    resolve(res)
                }).catch(error => {
                    reject(error)
                })
            })
        },
        //通过类型获取轮播图
        GetBannerListByType({ commit }, type) {
            return new Promise((resolve, reject) => {
                getBannerListByType({ type }).then(res => {
                    resolve(res)
                }).catch(error => {
                    reject(error)
                })
            })
        },
        //关于我们图片
        GetAboutMeList({ commit }, {type,current,size}) {
            return new Promise((resolve, reject) => {
                getAboutMeList({type,current,size}).then(res => {
                    resolve(res)
                }).catch(error => {
                    reject(error)
                })
            })
        }
    }
}

export default photo
